<template>
  <div class="sort">
    <div class="sort__header">
      <div>学霸榜</div>
      <span @click="toMore">更多</span>
    </div>
    <div class="sort__content">
      <div class="sort__item" @click="toMineCenter">
        <img class="hg" src="@/assets/images/one.png" />
        <div class="sort__inner">
          <img class="avatar" src="@/assets/images/tx.png" />
          <span class="no">No.1</span>
          <span class="name">力宏</span>
          <div>学分:122</div>
        </div>
      </div>
      <div class="sort__item">
        <img class="hg" src="@/assets/images/two.png" />
        <div class="sort__inner" style="background: rgba(255, 176, 13, 0.2)">
          <img
            class="avatar"
            style="border-color: #ffb00d"
            src="@/assets/images/tx.png"
          />
          <span
            class="no"
            style="background-color: #ffc140; border-color: #ffb00d"
            >No.2</span
          >
          <span class="name">力宏</span>
          <div style="background-color: #ffc140">学分:122</div>
        </div>
      </div>
      <div class="sort__item">
        <img class="hg" src="@/assets/images/three.png" />
        <div class="sort__inner" style="background: rgba(13, 198, 120, 0.2)">
          <img
            class="avatar"
            style="border-color: #0dc678"
            src="@/assets/images/tx.png"
          />
          <span
            class="no"
            style="background-color: #0dc678; border-color: #00ae65"
            >No.3</span
          >
          <span class="name">力宏</span>
          <div style="background-color: #0dc678">学分:122</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();
const toMore = () => {
  router.push({
    path: "/charts",
  });
};
//学员中心
const toMineCenter = () => {
  router.push({
    path: "/student",
  });
}
</script>
<style lang="scss" scoped>
.sort {
  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    div {
      font-family: PingFangSC-Medium;
      font-size: 18px;
      color: #171a1d;
    }
    span {
      font-family: PingFangSC-Regular;
      font-size: 14px;
      color: #676b6b;
    }
  }
  &__content {
    display: flex;
    justify-content: space-around;
    background-color: #fff;
    border-radius: 4px;
    padding: 8px 0 38px 0;
  }
  &__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    .hg {
      width: 25px;
      height: 20px;
    }
    .avatar {
      position: absolute;
      top: -20px;
      width: 48px;
      height: 48px;
      border-radius: 50%;
      border: 1px solid #ff3b3b;
    }
  }
  &__inner {
    padding-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 45, 45, 0.1);
    border-radius: 10px;
    width: 96px;
    height: 120px;
    transform: translateY(24px);
    position: relative;
    .no {
      width: 53px;
      height: 20px;
      background: #ed7243;
      border: 1px solid #ed4343;
      border-radius: 4px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: PingFangSC-Semibold;
      font-size: 14px;
      color: #ffffff;
      margin: 4px 0;
    }
    .name {
      font-family: PingFangSC-Medium;
      font-size: 14px;
      color: #272b2d;
    }
    div {
      margin-top: 4px;
      text-align: center;
      line-height: 26px;
      background: #ed7243;
      border-radius: 13px;
      width: 78px;
      height: 26px;
      font-family: PingFangSC-Medium;
      font-size: 14px;
      color: #ffffff;
    }
  }
}
</style>
